export default{
  numToPercent(num){
    if(!num){
      return '0%'
    }
    return (num * 100).toFixed(2) + '%'
  },
  numToMoney(num){
    if(!num){
      return '0'
    }
    if(isNaN(num)){
      Number(num)
      num = num.toFixed(2)
      num = parseFloat(num)
      num = num.toLocaleString()
    }
    return num;
  },
  numFormat(num){
    if(!num){
      return '0'
    }
    return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,")
  }
}